﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Sherwood.SignOn.Server.Models.ViewModels.RegisterViewModel>" %>
<%@ Import Namespace="Sherwood.SignOn.Server.Models" %>
<%@ Import Namespace="Sherwood.Mvc.Html" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%= Translations.Register_Title %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
 	<div class="register">
    <script type="text/javascript">
        $(document).ready(function() {
            $('#calDateOfBirth').datepicker({ buttonText: '...', changeMonth: true, changeYear: true, yearRange: '1890:<%= DateTime.Now.Year %>', showOn: 'button', dateFormat: 'yy-mm-dd' });
            $('form').submit(function() {
                $('#calDateOfBirth')[0].disabled = false;
            });
        });   
    </script>

    <h2><%= Translations.Register_Title %></h2>
    <%= Translations.Register_Intro_Text.Parameterize(Model) %>
    <%= Html.ValidationMessage("") %>
    <% Html.BeginForm(); %>
    <div class="input-title"><%= Translations._Username %></div>
    <div class="input"><%= Html.TextBox("UserName")  %>
    <%= Html.ValidationMessage("UserName")  %></div>

    <div class="input-title"><%= Translations._Password %></div>
    <div class="input"><%= Html.Password("Password")  %>
    <%= Html.ValidationMessage("Password")  %></div>
    
    <div class="input-title"><%= Translations.ChangePassword_Confirm_Password %></div>
    <div class="input"><%= Html.Password("Password2")  %>
    <%= Html.ValidationMessage("Password2")  %></div>

		<div class="input-title"><%= Translations._First_Name %></div>
    <div class="input"><%= Html.TextBox("FirstName")  %>
    <%= Html.ValidationMessage("FirstName")  %>
    </div>
    <div class="input-title"><%= Translations._Last_Name %></div>
    <div class="input"><%= Html.TextBox("LastName")  %>
    <%= Html.ValidationMessage("LastName")  %>
    </div>

    <div class="input-title"><%= Translations._Email %></div>
    <div class="input"><%= Html.TextBox("Email")  %>
    <%= Html.ValidationMessage("Email")  %></div>
    <div class="input-title"><%= Translations._Cell_Phone %></div>
    <div class="input"><%= Html.TextBox("Mobile")  %>
    <%= Html.ValidationMessage("Mobile")  %>
    </div>
    <div class="input-title"><%= Translations._Date_Of_Birth %></div>
    <div class="input birth"><%= Html.TextBox("DateOfBirth", ((Model != null && Model.DateOfBirth.HasValue) ? Model.DateOfBirth.GetValueOrDefault().ToString("yyyy-MM-dd") : null), new { id = "calDateOfBirth", disabled = "true" })%>
    <%= Html.ValidationMessage("DateOfBirth")  %>
    </div> 
    <!--div class="input-title"><%= Translations._Gender %></div>
    <div class="input"><%= Html.DropDownList("Gender", EnumSelectList.GetList(typeof(Sherwood.SignOn.Gender), Convert.ToInt32(ViewData["Gender"]), false))%>
    <%= Html.ValidationMessage("Gender")  %>
    </div-->
    <div class="spacer"></div>
    <div class="input-title"><%= Translations._Country %></div>
    <div class="input"><%= Html.DropDownList("Country", CountrySelectList.GetList(ViewData["Country"],false))%>
    <%= Html.ValidationMessage("Country")  %></div>
    
    <div class="input-title"><%= Translations.Register_Preferred_Language %></div>
    <div class="input"><%= Html.DropDownList("CultureName1", CultureSelectList.GetList(ViewData["CultureName1"],false), new { onchange = "//$('#submit').click();" })%>
    <%= Html.ValidationMessage("CultureName1")  %>
    </div>
    <div class="input-title"><%= Translations.Register_Second_Language_Preference %></div>
    <div class="input"><%= Html.DropDownList("CultureName2", MediumCultureSelectList.GetList(ViewData["CultureName2"],false), new { onchange = "//$('#submit').click();" })%>
    <%= Html.ValidationMessage("CultureName2")  %>
    </div>
    <div class="input-title"><%= Translations.Register_Third_Language_Preference %></div>
    <div class="input"><%= Html.DropDownList("CultureName3", ShortCultureSelectList.GetList(ViewData["CultureName3"],false), new { onchange = "//$('#submit').click();" })%>
    <%= Html.ValidationMessage("CultureName3")  %>
    </div>
    <div class="spacer"></div>
    <div class="submit"><input type="submit" name="submit" id="submit" value="<%= Translations.Register_Create_Button %>" /></div>

    <% Html.EndForm(); %>
    <%= Translations.Register_Footer_Text.Parameterize(Model) %>
	</div>
</asp:Content>
